# -*- coding:utf-8 -*- 
import time
import bottle
from   bottle import route, error, run

#页面显示时间

#def application(env,start_response):
#  start_response('200 OK', [('Content-Type','text/html'),('charset','UTF-8')])
#  
#  systime = time.strftime("%A %Y-%m-%d %H:%M:%S", time.localtime())
#  return ["系统时间: %s" % systime]

@route('')
@route('/')
@route('/index.html')
def index():
   return '<h1>uwsgi时间调整系统 </h1>'


@route('/showtime')
def showtime():
  print   time.strftime("%A %Y-%m-%d %H:%M:%S", time.localtime())
  return "this is test "


if __name__ == '__man__':
  bottle.run(host='0.0.0.0', port=8080)
else:
  # 三种形式都可以
  #edtime = application = bottle.default_app()
  #app = application = bottle.default_app()
   application = bottle.default_app()


# https://community.runabove.com/kb/en/development/how-to-run-bottle-uwsgi-nginx.html
